import React from 'react';
import ReactDOM from 'react-dom';
import { Editor, EditorState } from 'draft-js';

import './index.css';

function myBlockStyleFn(contentBlock) {
  const type = contentBlock.getType();
  if (type === 'blockquote') {
    return 'superFancyBlockquote';
  }
}

class MyEditor extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      editorState: EditorState.createEmpty(),
      value: 'hello '
    };
    this.onChange = editorState => this.setState({ editorState });
  }
  render() {
    return (
      <Editor blockStyleFn={myBlockStyleFn} editorState={this.state.editorState} onChange={this.onChange} />
    );
  }
}

export default MyEditor;